﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for MeterTest and is intended
    ///to contain all MeterTest Unit Tests
    ///</summary>
    [TestClass()]
    public class MeterTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Meter Constructor
        ///</summary>
        [TestMethod()]
        public void MeterConstructorTest() {
            Meter target = new Meter();
            Assert.AreEqual("<meter></meter>", target.ToString());
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            Meter target = new Meter();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for High
        ///</summary>
        [TestMethod()]
        public void HighTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.High = expected;
            actual = target.High;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Low
        ///</summary>
        [TestMethod()]
        public void LowTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.Low = expected;
            actual = target.Low;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Max
        ///</summary>
        [TestMethod()]
        public void MaxTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.Max = expected;
            actual = target.Max;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Min
        ///</summary>
        [TestMethod()]
        public void MinTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.Min = expected;
            actual = target.Min;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Optimum
        ///</summary>
        [TestMethod()]
        public void OptimumTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.Optimum = expected;
            actual = target.Optimum;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Value
        ///</summary>
        [TestMethod()]
        public void ValueTest() {
            Meter target = new Meter();
            Nullable<float> expected = 1.0F;
            Nullable<float> actual;
            target.Value = expected;
            actual = target.Value;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Meter m = new Meter();
            Form f = new Form();
            f.ID = "formid";
            m.Form = f;
            m.High = 1.0F;
            m.Low = 1.5F;
            m.Max = 2.0F;
            m.Min = 2.5F;
            m.Optimum = 3.0F;
            m.Value = 3.5F;
            Assert.AreEqual("<meter form=\"formid\" " +
                "high=\"1\" " +
                "low=\"1.5\" " +
                "max=\"2\" " +
                "min=\"2.5\" " +
                "optimum=\"3\" " +
                "value=\"3.5\"></meter>", m.ToString());
        }
    }
}
